﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace LowLevelGraphics.Types
{
    /// <summary>
    /// 
    /// </summary>
    public class Size3d : ICloneable 
    {
        protected int m_nWidth = -1;
        protected int m_nHeight = -1;
        protected int m_nDepth = -1;

        /// <summary>
        /// Initializes a new instance of the <see cref="Size3d"/> class.
        /// </summary>
        /// <param name="_nDepth">The _n depth.</param>
        /// <param name="_nWidth">Width of the _n.</param>
        /// <param name="_nHeight">Height of the _n.</param>
        public Size3d(int _nDepth, int _nWidth, int _nHeight)
        {
            this.m_nDepth = _nDepth;
            this.m_nWidth = _nWidth;
            this.m_nHeight = _nHeight;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Size3d"/> class.
        /// </summary>
        /// <param name="_size3d">The _size3d.</param>
        internal Size3d(Size3d _size3d)
        {
            this.m_nDepth = _size3d.m_nDepth;
            this.m_nWidth = _size3d.m_nWidth;
            this.m_nHeight = _size3d.m_nHeight;
        }

        /// <summary>
        /// Adds the specified _SZ1.
        /// </summary>
        /// <param name="_sz1">The _SZ1.</param>
        /// <param name="_sz2">The _SZ2.</param>
        /// <returns></returns>
        public static Size3d Add(Size3d _sz1, Size3d _sz2)
        {
            return new Size3d(_sz1.m_nDepth + _sz2.m_nDepth, _sz1.m_nWidth + _sz2.m_nWidth, _sz1.m_nHeight + _sz2.m_nHeight);
        }

        public static Size3d Subtract(Size3d _sz1, Size3d _sz2)
        {
            return new Size3d(_sz1.m_nDepth - _sz2.m_nDepth, _sz1.m_nWidth - _sz2.m_nWidth, _sz1.m_nHeight - _sz2.m_nHeight);
        }

        public int Height
        {
            get { return m_nHeight; }
            set { m_nHeight = value; }
        }

        /// <summary>
        /// Gets or sets the width.
        /// </summary>
        /// <value>The width.</value>
        public int Width
        {
            get { return m_nWidth; }
            set { m_nWidth = value; }
        }

        /// <summary>
        /// Gets or sets the depth.
        /// </summary>
        /// <value>The depth.</value>
        public int Depth
        {
            get { return m_nDepth; }
            set { m_nDepth = value; }
        }

        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public object Clone()
        {
            return new Size3d(this);
        }
    }
}
